package com.example.springboot_manage.util;

import com.example.springboot_manage.vo.ResultVO;

public class ResultUtil {
    public static ResultVO success(Object data,Integer count){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        resultVO.setData(data);
        resultVO.setCount(count);
        return resultVO;
    }

    public static ResultVO success01(Object data){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        resultVO.setData(data);
        return resultVO;
    }
    public static ResultVO success(){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(200);
        resultVO.setMsg("成功");
        return resultVO;
    }


    public static ResultVO error(String error){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(1);
        resultVO.setMsg(error);
        resultVO.setData(null);
        resultVO.setCount(0);
        return resultVO;
    }
    public static ResultVO error(){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(1);
        resultVO.setMsg("error");
        return resultVO;
    }
}
